//
//  HomePageDetailRes.m
//  Taste
//
//  Created by 徐昊 on 16/9/18.
//  Copyright © 2016年 徐昊. All rights reserved.
//

#import "HomePageDetailRes.h"
#import "HomePageDetailContent.h"
#import "HomePageDetailMore.h"
#import "Latestcon.h"

@implementation HomePageDetailRes

- (void)setValue:(id)value forKey:(NSString *)key {
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"more"]) {
        NSMutableArray *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            HomePageDetailMore *more = [HomePageDetailMore modelWithDic:dic];
            [array addObject:more];
        }
        _more = array;
    }
    if ([key isEqualToString:@"latestCon"]) {
        NSMutableArray *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            Latestcon *latestCon = [Latestcon modelWithDic:dic];
            [array addObject:latestCon];
        }
        _latestCon = array;
    }
    if ([key isEqualToString:@"content"]) {
        NSMutableArray *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            HomePageDetailContent *content = [HomePageDetailContent modelWithDic:dic];
            [array addObject:content];
        }
        _content = array;
    }
    if ([key isEqualToString:@"id"]) {
        _HomePageDetail_id = value;
    }
    if ([key isEqualToString:@"typeid"]) {
        _HomePageDetail_typeid = value;
    }
}

+ (NSDictionary *)objectClassInArray{
    return @{@"content" : [HomePageDetailContent class], @"latestCon" : [Latestcon class], @"more" : [HomePageDetailMore class]};
}

@end
